<%@ page language="java" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>盐城电信装维人员管理系统</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	<script src="JQueryEasyUi/Cookie.js" type="text/javascript"></script>
	-->
	<link rel="stylesheet" type="text/css" href="ui/style.css">
	<link href="ui/themes/icon.css" rel="stylesheet" type="text/css" />
    <link href="ui/themes/default/easyui.css" rel="stylesheet" type="text/css" />

    <script src="ui/jquery-1.6.min.js" type="text/javascript"></script>
    <script src="ui/jquery.easyui.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="ui/locale/easyui-lang-zh_CN.js"></script>
	
    
    
	<script type="text/javascript">
        $(function(){		
			$('#win').window({  
			    width:460,  
			    height:300,  
			    modal:false  
			}); 
			$('#tt').tabs({
				border:false,
				fit:true
			});
			
			//登录按钮操作
			$("#btnLogin").click(function() {
				//$("#btnLogin").attr({"disabled":"disabled"});
				if($('#ff').form('validate')==true){ 
					var username = document.getElementById("username").value;
                	var password = document.getElementById("password").value;
					loginSys(username, password);
				}			
            });
	        //重置按钮操作
	        $("#btnReset").click(function() {
	            document.getElementById("username").value="";
	            document.getElementById("password").value="";
	        }); 
		});
		
		//登陆操作
        function loginSys(username,password) {
            $.ajax({
                type: "POST",
                dataType: "json",
                //cache:true,
                url: "Logon.action",
                data: { "user.username": username, "user.password": password },                              
                success: function(json) {
                	//alert(json.result.status);
                    if (json.result.status == 1) {
                        window.location.href = "main.jsp";
                        //$.messager.alert('正确', json.result.message, 'error');
                    }
                    else {
                        $.messager.alert('错误', '账号或密码错误!', 'error');
                    }
                },
                error: function() {
                    $.messager.alert('错误', '登录失败...<br>请检查帐号密码或联系管理员!', 'error');
                }
            });
        }
        
    </script>
	<style>
	    .bg{ 
	        filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='ui/images/background.jpg' ,sizingMethod= 'scale' ); 
	        background-repeat: no-repeat; 
	        background-positon: 100%, 100%; 
	        font: normal 12px tahoma, arial, verdana, sans-serif; 
	        margin: 0; 
	        padding: 0; 
	        border: 0 none; 
	        overflow: hidden; 
	        height: 100%; 
			z-index:0;
			position:relative;
	    } 
	</style>
  </head>
  
  <body> 
  	<div class="bg">
 	<div class="easyui-window" title="盐城电信装维人员管理系统" icon="icon-people" minimizable="false" maximizable="false" closable="false" style="width:464px;height:300px;background: #fafafa;">  
    <div class="easyui-layout" fit="true" > 
    	<div region="north" border="false" style="width:464px;height:70px;margin:0px;padding:0px;">
    		<img border="0" width="450px" height="70px" style="display:block;" src="ui/images/login_banner.png" />
    	</div>        
        <div region="center" border="false">  
            <div class="easyui-tabs" fit="true" border="false">  
                <div title="系统登录" style="margin:auto">  
                    <div border="false" style="margin-top:37px;text-align:center;MARGIN-RIGHT: 127px;MARGIN-LEFT: 127px;">
			            <form id="ff">
			                <table>
			                    <tr>
			                        <td>账号：</td>
			                        <td><input class="easyui-validatebox" id="username" name="user.username" style="width: 150px;" required="true"/></td>
			                    </tr>
			                    <tr>
			                        <td>密码：</td>
			                        <td><input class="easyui-validatebox" type="password" id="password" name="user.password" style="width: 150px;" required="true"/></td>
			                    </tr>
			                </table>
			            </form>
					</div> 
                </div>  
                <div title="关于">  
                    <div style="padding:20px">  
                    	盐城电信装维人员管理系统<br><br>
						版权所有 © 2011 盐城电信网络运行维护部 <br><br>
						<b>技术支持</b><br>
						盐城电信政企客户支撑中心   
                    </div>  
                </div>  
            </div>  
        </div>  
        <div region="south" border="false" style="text-align:right;height:30px;line-height:30px;padding-right:10px;">   
            <a class="easyui-linkbutton" id="btnLogin"  icon="icon-key" href="javascript:void(0)">登录</a>             
            <a class="easyui-linkbutton" id="btnReset" icon="icon-reload" href="javascript:void(0)">重置</a>
        </div>  
    </div>  
</div>
  </div>
  </body>
</html>
